﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
<html xmlns="http://www.w3.org/1999/xhtml">
<head>   
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />   
<title>提交信息</title>
</head>   
<body>
<div align="center">
<?php
require "CURD.php";
$rs= new DBHelper();
$res = $rs->fetch_all("SHOW COLUMNS FROM `{$_GET['type']}`");
$rt = array();
if ($res instanceof mysqli_result)
{
    while (($row = $res->fetch_assoc()) != FALSE)
    {
        $row['CanBeNull'] = $row['Null'] === 'YES';   //字段值是否可以为空，是的话值为'YES'
        $rt[] = $row;
    }
}
$ss=count($rt);
echo "<form action='api.php?act=input_word&type={$_GET['type']}' method='post'>";
echo '<h1>'.$_GET['type'].'</h1>';
for ($i = 0; $i < $ss; $i++) {
    if($i>0){
        echo $rt[$i]['Field']."<input type='text' name={$rt[$i]['Field']}>";
        echo "<br>";
    }
}
echo '<input type="submit" value="提交">';
echo '</form>';
?>
</div>
</body>   
</html>